//
//  SRHomeViewController.m
//  Fitness
//
//  Created by SunZhongyuan on 2018/6/4.
//  Copyright © 2018年 SunZhongyuan. All rights reserved.
//

#import "SRHomeViewController.h"
#import "LSPPageView.h"
#import "SRNoteViewController.h"
#import "SRAttentionViewController.h"


@interface SRHomeViewController ()

@property(nonatomic, strong) LSPPageView *pageView;

@end

@implementation SRHomeViewController {
    CGFloat kTabBarHeight;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    kTabBarHeight = self.tabBarController.tabBar.frame.size.height;
    [self.view addSubview:self.pageView];
}



#pragma mark - getters

- (LSPPageView *)pageView {
    if (_pageView == nil) {
        SRAttentionViewController *attentionVC = [[SRAttentionViewController alloc] initWithTitle:@"" needBack:NO needNavBar:NO];
        SRNoteViewController *noteVC = [[SRNoteViewController alloc] initWithTitle:@"" needBack:NO needNavBar:NO];
        LSPTitleStyle *titleStyle = [[LSPTitleStyle alloc] init];
        titleStyle.isTitleViewScrollEnable = NO;
        titleStyle.font = font(16);
        titleStyle.isShowCover = NO;
        titleStyle.bottomLineColor = [UIColor whiteColor];
        titleStyle.bottomLineH = 1.0;
        _pageView = [[LSPPageView alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, kScreenWidth, kScreenHeight-kStatusBarHeight-kTabBarHeight) titles:@[@"关注", @"健身干货"] style:titleStyle childVcs:@[attentionVC, noteVC] parentVc:self];
        _pageView.backgroundColor = [UIColor clearColor];
    }
    return _pageView;
}



@end
